import datetime
import kafka

 from coin.base.datetime_util import to_timestamp_int
from coin.tool.strat_monitor.util.monitor_util import get_topic_from_config
from coin.util.queue.config import KafkaConfig
from coin.util.queue.reader import run_from_kafka_archive

 strategy_config_filename = '../../coin_deploy/support_monitor/config/strat_config/strat_all.json'
kafka_config_filename = '../../coin_deploy/support_monitor/config/kafka_config.json'


 def callback(partition, record):
  pass


 timestamp_from = datetime.datetime(2019, 4, 28, 17, 28)
timestamp_to = datetime.datetime(2019, 5, 1)

 topics = get_topic_from_config(
      strategy_config_filename, kafka_config_filename)
topics = [
    'STRAT_strategy-19.aliyun-cn-hongkong_unhedged_mm_okex_usdt_1',
    #'STRAT_strategy-02.ap-northeast-1.huobi_lm_agg_huobi_bchabc_usdt',
    #'STRAT_strategy-02.ap-northeast-1.huobi_lm_agg_huobi_btc_usdt',
    #'STRAT_strategy-02.ap-northeast-1.huobi_lm_agg_huobi_eos_usdt',
    #'STRAT_strategy-02.ap-northeast-1.huobi_lm_agg_huobi_eth_usdt',
]
kafka_config = KafkaConfig.from_cmd_config(kafka_config_filename)

run_from_kafka_archive(
    topics=topics,
    kafka_config=kafka_config,
    timestamp_from=timestamp_from,
    timestamp_to=timestamp_to,
    callback=callback)
